#ifndef CART_ITEM_H_
#define CART_ITEM_H_

#include <string>
#include <sstream>
using namespace std;


struct Cart_item {
public:
	// constructors
	Cart_item () {}
	Cart_item (int ca_item_id, int ca_id, int pr_id, int pr_quantity)
		: cart_item_id(ca_item_id), cart_id(ca_id), prod_id(pr_id), prod_qty(pr_quantity) {}

   // utility functions
	string display() const
		{
			//cart item display format
			stringstream sline (stringstream::in | stringstream::out);
			sline << cart_item_id << "\t\t" << cart_id << "\t\t" << prod_id << "\t\t" << prod_qty;
			return sline.str();
		}
	string write() const
		{
			//cart item display format
			stringstream sline (stringstream::in | stringstream::out);
			sline << cart_item_id << " " << cart_id << " " << prod_id << " " << prod_qty << "\n";
			return sline.str();
		}
 	// getter functions
	int getCartItemId() const {return cart_item_id;}
	int getCartId() const {return cart_id;}
	int getProdId() const {return prod_id;}
	int getProdQty() const {return prod_qty;}
	
	
private:
   //constants  

   // private data
	int cart_item_id;
	int cart_id;
	int prod_id;
	int prod_qty;
};


#endif //CART_ITEM_H_